//关闭弹出层的功能，配合文件设定的样式命名
 $('.ajax_content .close').click(
    function(){
        $('.ajax_content').removeClass('show')

        $('.ajax_content .info').html()

        $('.ajax_content_bg ').hide()

        $('.ajax_content .close ').hide()

        $('.ajax_content .info ').hide()
    }
)


//点击背景关闭
$('.ajax_content_bg ').click(
    function(){
        $('.ajax_content').removeClass('show')

        $('.ajax_content .info').html()

        $('.ajax_content_bg ').hide()

        $('.ajax_content .close ').hide()

        $('.ajax_content .info ').hide()
    }
)







//执行弹出逻辑
function show_message_box(type, id){
    layui.use('layer', function(){
        var layer = layui.layer;


        $.ajax({
            type:"POST",
            url:"/controller/modules/ajax_load_content.php",
            dateType:"json",
            data:{"act":'load' , "type":type , "id" :id },
            dataType:"json",
            beforeSend: function () {

                index =  layer.msg('正在查询中，请稍等', {
                    icon: 16,
                    shade:true,
                    time:10000,
                    shade: [0.8, '#393D49']
                },function(){

                });


            },
            success:function(data){
                if(data.error == 1){

                    var msg_box = layer.msg(data.message, {
                        icon: 5,
                        shade:true,
                        time:1000,
                        shade: [0.8, '#393D49']
                    });
                    //
                }
                else{
                    $('.ajax_content').addClass('show')
                    $('.ajax_content .info').html(data.content)
                    $('.ajax_content_bg ').show()
                    $('.ajax_content .close ').show()
                    $('.ajax_content .info ').show()
                }
            },

            complete: function (XHR, TS) {layer.close(index);    XHR = null ; $('.search_btn').removeAttr("disabled"); } ,
        })
    })
}